#define _CRT_SECURE_NO_WARNINGS 1

#include <stdio.h>
#include <malloc.h>

int* twoSum(int* nums, int numsSize, int target, int* returnSize) {
    int* ret = (int*)malloc(sizeof(int) * 2);
    int start = 0;
    int flag = 0;
    for (start = 0; start < numsSize; start++)
    {
        flag = 0;
        for (int i = start+1; i < numsSize; i++)
        {
            if ((nums[start] + nums[i]) == target)
            {
                ret[0] = start;
                ret[1] = i;
                flag = 1;
                break;
            }
        }
        if (flag == 1)
        {
            break;
        }
    }
    *returnSize = 2;
    return ret;
}

int main()
{
    int nums[] = { 3,2,4 };
    int ret = 0;
    int* show = twoSum(nums, 3, 6, &ret);
    printf("%d\n", show[0]);
    printf("%d\n", show[1]);

    return 0;
}